/*================ country.c ======================*/ 
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "country.h"


/* Create a new country struct */
country create_country(const char *locale, const char *name, const char *server){
	country place = (country) calloc(1, sizeof(struct _country));

	place->locale = (char*) calloc(strlen(locale), sizeof(char));
	place->name = (char*) calloc(strlen(name), sizeof(char));
	place->server = (char*) calloc(strlen(server), sizeof(char));

	strcpy(place->locale, locale);
	strcpy(place->name, name);
	strcpy(place->server, server);

	return place;
}

/* delete a country struct */
void delete_country(country *pais){
   
}

/* print to stdout a country struct */
void print_country(const country pais){
	if(pais != NULL){
		if (pais->locale != NULL || pais->name != NULL || pais->server == NULL){
			printf("country locale 	-%s\n", pais->locale);
			printf("country name 	-%s\n", pais->name);
			printf("country server 	-%s\n", pais->server);
		}
			else 
				printf("Erro: NULL country member\n");
	}
	else 
		printf("Erro: NULL country\n");
}
